package com.yunao.dao;

import com.yunao.entity.ArticleItem;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.Date;
import java.util.List;

public interface ArticleRepository extends JpaRepository<ArticleItem,Integer>,JpaSpecificationExecutor<ArticleItem> {
    List<ArticleItem> findAllByArticleUserIdAndArticleType(Integer userId, Integer articleType);

    List<ArticleItem> findAllByArticleTextLike(String word);

    Page<ArticleItem> findAll(Specification<ArticleItem> specification, Pageable pageable);

    @Override
    List<ArticleItem> findAllById(Iterable<Integer> iterable);

    List<ArticleItem> findAllByArticleSubjectId(Integer subjectId);

}
